//
// Created by Wirano on 2020/11/10.
//

#ifndef ANO_PORT_ANO_OPMV_CBTRACKING_CTRL_H
#define ANO_PORT_ANO_OPMV_CBTRACKING_CTRL_H

//==引用

#include "Ano_FcData.h"

//==定义
typedef struct
{
    //
    uint8_t target_loss;
    //
    int16_t opmv_pos[2];
    int16_t rp2pixel_val[2];
//	int16_t rp2p_fifo_lagging[3][2];

    //
    float decou_pos_pixel[2];
    float ground_pos_err_h_cm[2];
    float ground_pos_err_d_h_cmps[2];

    float target_gnd_velocity_cmps[2];
    //
    float exp_velocity_h_cmps[2];
}_ano_opmv_cbt_ctrl_st;

//==数据声明
extern _ano_opmv_cbt_ctrl_st ano_opmv_cbt_ctrl;

extern uint8_t find_circle;

//==函数声明

//static
static void ANO_CBTracking_Decoupling(uint8_t *dT_ms,float rol_degs,float pit_degs);
static void ANO_CBTracking_Calcu(uint8_t *dT_ms,int32_t relative_height_cm);
//public
void ANO_CBTracking_Task(uint8_t dT_ms);
void ANO_CBTracking_Ctrl(uint8_t *dT_ms,uint8_t en);

#endif //ANO_PORT_ANO_OPMV_CBTRACKING_CTRL_H
